 
1
On the Four Types of Weight Functions for Spatial 
Contiguity Matrix 
Yanguang Chen 
（Department of Geography, College of Environmental Sciences, Peking University, Beijing 100871, 
PRC. Email: chenyg@pku.edu.cn） 
 
Abstract: This is a “spatial autocorrelation analysis” of spatial autocorrelation. I use the 
1-dimension spatial autocorrelation function (ACF) and partial autocorrelation function (PACF) to 
analyze four kinds of weight function in common use for the 2-dimensional spatial autocorrelation 
model. The aim of this study is at how to select a proper weight function to construct a spatial 
contiguity matrix for spatial analysis. The scopes of application of different weight functions are 
defined in terms of the characters of their ACFs and PACFs. 
Key words: spatial autocorrelation; weight function; contiguity matrix; spatial weights matrix 
1 Introduction 
Spatial autocorrelation plays a very important role in spatial analysis of geographical systems 
(Haining, 2009). In fact, the analytical methods of spatial autocorrelation in geography fall into 
two classes--one is the 1-dimensional spatial autocorrelation based on the lag function without 
weight (Chen, 2008), and the other is the 2-dimension spatial autocorrelation based on the weight 
function without lag (Cliff and Ord, 1981). The latter, including Moran’s I and Geary’s C, is more 
familiar to geographers. One of the vital steps of spatial autocorrelation modelling is to construct a 
square spatial weights matrix (Getis, 2009). However, how to select weight function objectively is 
still a pending question remaining to be resolved. If we fail to choose a proper weight function, the 
result and effect of spatial analysis will not be satisfying and convincing, or even the calculation 
will be distorted (Chen, 2009). This letter will discuss four functions which can be used as weight 
function for 2-dimension spatial autocorrelation using the 1-dimension correlation function. The 
conclusions may be revealing for the students who plan to exercise spatial autocorrelation. 

 
2
2 Weight functions 
2.1 Spatial contiguity matrix 
Before constructing a spatial weights matrix, we must make a spatial contiguity matrix by using 
weight function. For n elements in a geographical system, a spatial contiguity matrix, C, can be 
expressed in the form 
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
=
nn
n
n
n
n
c
c
c
c
c
c
c
c
c
C
L
M
O
M
M
L
L
2
1
2
22
21
1
12
11
 .                           (1) 
where cij is a measurement used to compare and judge the degree of nearness or the contiguous 
relationships between region i and region j. Thus a spatial weights matrix can be defined as 
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
=
=
nn
n
n
n
n
w
w
w
w
w
w
w
w
w
C
C
W
O
M
O
M
M
L
L
2
1
2
22
21
1
12
11
0
 or 
⎥
⎥
⎥
⎥
⎦
⎤
⎢
⎢
⎢
⎢
⎣
⎡
=
=
nn
n
n
n
n
w
w
w
w
w
w
w
w
w
n
C
nC
W
O
M
O
M
M
L
L
2
1
2
22
21
1
12
11
0
*
,     (2) 
where 
∑∑
=
=
=
n
i
n
j
ijc
C
0
0
0
, 
1
0
0
=
∑∑
=
=
n
i
n
j
ij
w
. 
Obviously, W is mathematically equivalent to W*. In literature, W* used to act as spatial weights 
matrix. However, I argue that W has an advantage of W* because we can build more regular model 
of spatial autocorrelation based on W. 
2.2 Spatial weight function 
Sometimes it appears as if there are two kinds of major ‘forces’ acting in natural world. The 
first force is one which tends to spread everything through space, while the second force, on the 
contrary, striving toward clustering and isolation. The first force leads to uniformity and equality 
on the whole, while the second force results in differentiability and inequality (El Naschie, 2000). 
The first force can be likened to the action at a distance on the earth surface, while the second 
force can be compared to localization in complex geographical system (Chen, 2008). The action at 
a distance reminds us the first law of geography of Tobler (1970, 2004), while localization 

 
3
suggests some force anti the first law of geography. The interaction of the two forces brings on 
four kinds of spatial action or correlation: (1) long-distance action or global correlation; (2) 
quasi-long-distance correlation action or quasi-global correlation; (3) short-distance action or 
quasi-local correlation; (4) proximal action or local correlation. The four types of action or 
correlation can be described with four different functions (Figure 1). 
 (1) Long-distance action or global correlation and inverse power function. The inverse power 
law reflects the action at a distance in geography, so the global correlation can be reflect with an 
inverse power function such as 
b
ij
ij
r
c
−
=
.                                     (3) 
where b denotes the distance friction coefficient (generally, b=1). This kind weight function comes 
from the impedance function of the gravity model (Haggett et al, 1977). Cliff and Ord (1973, 1981) 
used this kind of function to construct spatial congruity matrix, which is sometimes called the 
Cliff-Ord weights. 
(2) Quasi-long-distance correlation action or quasi-global correlation and negative exponential 
function. The quasi-global correlation can be described by the following exponential function 
)
exp(
r
r
c
ij
ij
−
=
.                                 (4) 
where rij refers to the distance between location i and location j, and r , the average distance of all 
the distances between any two locations. This function can be derived from the entropy- 
maximizing model of Wilson (1970). 
 (3) Short-distance action or quasi-local correlation and semi-step function. Short-distance 
action can be also called quasi-proximal action. Defining a critical distance r0, the short-distance 
action can be describe by a semi-staircase function 
⎩
⎨
⎧
>
≤
=
0
0
 
if
,0
 
if
,1
r
r
r
r
c
ij
ij
,                                (5) 
which gives a binary matrix or 0-1 contiguity matrix. In fact, the semi-step function can be 
regarded as the special case of the negative exponential function. If 
r
rij <<
, then cij→1; while if 
r
rij >>
as given, then cij→0. 
(4) Proximal action or local correlation and step function. Proximal action is an immediate 

 
4
action or neighboring correlation. If region i is next to region j, the value of spatial correlation is 1, 
otherwise, the value is 0. The local correlation can be described by the step function 
⎩
⎨
⎧
=
others
,0
region 
on 
 
is
 
region 
 
if
,1
j
i
cij
.                         (6) 
This also gives a 0-1 contiguity matrix. 
Now, a question arises--which weight functions should we choose? This depends on the type of 
spatial correlation or interaction in given study region. In order to clarify the criterion of selecting 
a weight function, we must know the similarities and differences between these weight functions. 
 
Figure 1 The four types of spatial actions corresponding to four kinds of weight function 
3 Comparison and analysis 
None is perfect in this world. Everything has its strong and weak points as a foot is oft-times 
too short and inch too long. We can employ the 1-dimension spatial autocorrelation analysis to 
reveal to advantages and disadvantages of different weight function for the 2-dimensional spatial 
autocorrelation analysis. The autocorrelation function (ACF) of a space series can be expressed as 
∑
∑
=
+
=
−
−
−
−
=
N
i
i
N
k
i
k
i
i
c
c
c
c
c
c
k
R
1
2
1
)
(
)]
)(
[(
)
(
,                          (7) 
where k refers to a displacement, or spatial lag, R(k), to ACF corresponding to displacement k, ci 
represents a sample path of a spatial series with a length N, which can be generated by the 
Spatial correlation 
Action at a distance 
Spatial localization 
Quasi-global action
Quasi-local action
Local action 
Global action 
Inverse power 
function
Exponential 
function
Semi-staircase 
function
Staircase 
function

 
5
above-given weight function, and c , the average value of ci, that is 
∑
=
=
N
i
ic
N
c
1
1
.                                (8) 
After calculating ACF, we can compute the partial autocorrelation function (PACF), which can be 
given by the well-known Yule-Walker equations. ACF implies both direct and indirect action, and 
PACF means only direct influence. You can find equation (7) and the Yule-Walker equation in any 
textbook on space/time series. It is no matter that if you have little idea of ACF and PACF and 
don’t know how to work out them. If so, please utilize SPSS (Statistical Package for the Social 
Sciences) or other computer program used for statistical analysis. Actually, SPSS is to a 
mathematical beginner what a point-and-shoot camera is to a traveler knowing little about 
photography. 
Now, we can generate four spatial series by using equations (3), (4), (5), and (6). Suppose the 
length of the sample path is N=500. First, let b=1 and r=1, 2, …, 500, we can produce a simulative 
spatial series, 1/r, for equation (3). Second, let r=0, 1, 2, …, 499, and 
5.
249
499
/
=
=∑
r
r
r
, 
we can yield a spatial series, exp(-r/r ), for equation (4). Third, let r=0, 1, 2, …, 499, r0=4, we can 
create a series such as 1, 1, 1, 1, 1, 0, 0,…0 for equation (5). Fourth, let r=0, 1, 2, …, 499, it is 
easy for us to make a series in the form 1, 1, 0, 0,…0 for equation (6). Note that there are two “1” 
rather than one “1” at the beginning of the fourth series. In fact, when k=0, the correlation is with a 
region itself; when k=1, the correlation is with the neighbor. The calculations of ACFs and PACFs 
are shown in Figures 2, 3, 4, and 5, and the characters of these ACFs and PACFs are displayed in 
Table 1. For each histogram of ACF or PACF, the two transverse lines is called the 
“two-standard-error bands”, according to which we can judge whether or not there is significant 
difference between ACF or PACF values and zero.  
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Displacement
ACF
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
Displacement
ACF
 

 
6
a. ACF histogram                   b. PACF histogram 
Figure 2 The histograms of spatial ACF and PACF based on the inverse power-law distribution 
-0.2
0.0
0.2
0.4
0.6
0.8
1.0
1.2
Displacement
ACF
-0.2
0.0
0.2
0.4
0.6
0.8
1.0
1.2
Displacement
ACF
 
a. ACF histogram                 b. PACF histogram 
Figure 3 The histograms of spatial ACF and PACF based on the negative exponential distribution 
-0.2
0.0
0.2
0.4
0.6
0.8
1.0
Displacement
ACF
-0.4
-0.2
0.0
0.2
0.4
0.6
0.8
1.0
Displacement
ACF
 
a. ACF histogram                   b. PACF histogram 
Figure 4 The histograms of spatial ACF and PACF based on the semi-step-like distribution 
-0.2
-0.1
0.0
0.1
0.2
0.3
0.4
0.5
0.6
Displacement
ACF
-0.4
-0.2
0.0
0.2
0.4
0.6
Displacement
ACF
 
a. ACF histogram                   b. PACF histogram 
Figure 5 The histograms of spatial ACF and PACF based on the step-like distribution 
Apparently, for the inverse power function, both ACF and PACF have trailing phenomena, the 
correlation functions die out little by little (Figure 2). In short, both ACF and PACF suggest 
long-distance action or global correlation. For the negative exponential function, ACT tails out, 
but PACF cuts off after displacement k=1(Figure 3). ACF suggests long-distance action or global 
correlation, while PACF suggest proximal action or local correlation. For the semi-step function, 
ACT cuts off at displacement k=5, but PACF periodically changes and dies away (Figure 4). ACF 

 
7
suggests short-distance action or quasi-local correlation, while PACF suggest quasi-distant effect 
and quasi-periodic change. PACF breaks out and through the “two-standard-error bands” every 
four “lags” until fading. For the step function, ACT cuts off after displacement k=1, but PACF 
displays a gradual two-sided damping and alternate effect (Figure 5). ACF suggests proximal 
action or local correlation, while PACF suggest distant effect and quasi-periodic change. PACF 
breaks out and through the “two-standard-error bands” every one “lag” until going out. 
Table 1 Comparison of ACF and PACF between the four weight functions 
CF 
Power function 
Exponential function 
Semi-step function 
Step function 
ACF 
Tail off (global) 
Tail off (global) 
Cut off (quasi-local) 
Cut off (local) 
PACF 
Tail off (global) 
Cut off (local) 
Tail off (quasi-period) 
Tail off (period) 
4 Discussion and conclusion 
The difference between inverse power function and the negative exponential function is clear. 
An exponential function suggests a characteristic scale (r ) and implies simplicity, while a power 
function suggests no characteristic scale and implies complexity (Chen, 2010). Batty and Kim 
(1992) made interesting discussion about exponential function and power function. Sometimes, 
exponential distributions indicate localization (Chen, 2008). The step function seems to be very 
simple, but it is actually complex because of oscillating and damping PACF. This suggests that 
step function is better for negative spatial autocorrelation than for positive spatial autocorrelation. 
The four weight functions can be compared with one another and the principal scopes of 
application of them are defined as below (Table 2). 
Table 2 Comparison of spheres of application of the four weight functions 
Function 
System type 
Scale 
Positive/Negative 
Inverse power function 
Complex systems
Large scale
Positive 
Negative exponential function Simple systems 
Small scale
Positive 
Semi-step function 
Complex systems
Large scale
Positive or negative 
Step function 
Simple systems 
Large scale
Negative 
 
The main conclusions of the letter can be drawn as follows. First, if the geographical 
phenomena follow a power law, you had better select the inverse power law as a weight function. 
The inverse power law is suitable for the large scale complex systems with global correlation. 
Second, if the geographical phenomena take on exponential distribution, you had better choose the 

 
8
negative exponential function as a weight function. The negative exponential function is fit for the 
medium-sized or small scale simple system with quasi-local correlation. Third, if the geographical 
phenomena are of localization, you had better select the semi-step or step function. The step 
function is appropriate for the region systems with local negative correlation. The semi-step 
function has a special importance in spatial scaling analysis, which will be discussed in a 
companion paper. 
References 
Batty M, Kim KS (1992). Form follows function: reformulating urban population density functions. 
Urban Studies, 29(7):1043-1070 
Chen Y G (2008). A wave-spectrum analysis of urban population density: entropy, fractal, and spatial 
localization. Discrete Dynamics in Nature and Society, Vol.2008, Article ID 728420, 22 pages 
Chen YG (2009). Reconstructing the mathematical process of spatial autocorrelation based on the 
Moran statistic. Geographical Research, 28 (6): 1449-1463[IC] 
Chen YG (2010). Exploring fractal parameters of urban growth and form with wave-spectrum analysis. 
Discrete Dynamics in Nature and Society, Vol. 2010, Article ID 974917, 20 pages 
Cliff AD, Ord JK (1973). Spatial Autocorrelation. London: Pion Limited 
Cliff AD, Ord JK (1981). Spatial Processes: Models and Applications. London: Pion Limited 
El Naschie MS (2000). A very brief history of localization (Foreword). Chaos, Solitons and Fractals, 
11(10): 1479-1480 
Getis A (2009). Spatial weights matrices. Geographical Analysis, 41 (4): 404–410 
Haggett P, Cliff AD, Frey A (1977). Locational Analysis in Human Geography. London: Edward 
Arnold Ltd 
Haining RP (2009). Spatial autocorrelation and the quantitative revolution. Geographical Analysis, 41 
(4): 364–374 
Tobler W (1970). A computer movie simulating urban growth in the Detroit region. Economic 
Geography, 46(2): 234-240 
Tobler W (2004). On the first law of geography: A reply. Annals of the Association of American 
Geographers, 94(2): 304-310 
Wilson AG (1970). Entropy in Urban and Regional Modelling. London: Pion Press 
